package com.geek.image.domain;

import com.geek.image.handler.ImageSotre;

import java.awt.*;

// ImageStore的使用举例
public class ImageProcessingJob {
    private static final String BUCKET_NAME = "ai_images_bucket";
    private String code;
    private ImageSotreManager imageSotreManager;

    // 通过外部传的code来动态获取对象，code放在配置文件中
    public ImageProcessingJob(String code, ImageSotreManager imageSotreManager) {
        this.code = code;
        this.imageSotreManager = imageSotreManager;
    }
    //...省略其他无关代码...

    public void process() {
        Image image = null;//处理图片，并封装为Image对象
        ImageSotre imageStore = imageSotreManager.getImageStore(code);
        imageStore.upload(image, BUCKET_NAME);
    }
}